package com.gift.recommendation.modules.user.service;

import com.gift.recommendation.modules.user.dao.entity.AddressEntity;
import com.gift.recommendation.modules.user.dao.mapper.AddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author zzh <2658137258@qq.com>
 * @date 2023/2/16
 */
@Component
public class AddressService {

    @Autowired
    private AddressMapper addressMapper;

    public void insertSelective(AddressEntity addressEntity){
        addressMapper.insertSelective(addressEntity);
    }

    public List<AddressEntity> selectByExample(Example example) {
        return addressMapper.selectByExample(example);
    }

    public AddressEntity selectByPrimaryKey(Long id){
        return addressMapper.selectByPrimaryKey(id);
    }

    public void deleteByPrimaryKey(Long id){
        addressMapper.deleteByPrimaryKey(id);
    }

    public void updateByPrimaryKeySelective(AddressEntity addressEntity){
        addressMapper.updateByPrimaryKeySelective(addressEntity);
    }

    public void updateByExampleSelective(AddressEntity addressEntity,Example example){
        addressMapper.updateByExampleSelective(addressEntity,example);
    }

    public AddressEntity selectOneByExample(Example example){
        return addressMapper.selectOneByExample(example);
    }

    public void deleteByExample(Example example) {
        addressMapper.deleteByExample(example);
    }
}
